home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crosscountry USA Photo Safari
/
Crosscountry USA Photo Safari.iso
/
Data
/
cc_base
/
pak00_16bit_f.pk3
/
maintenance.tab.p
< prev
next >
Wrap
Text File
|
2003-01-03
|
17KB
|
507 lines
{
X = -230;
Y = 60;
state = 0;
rest_x = -230;
expand_x = -20;
Hidden = 1;
ScriptID = script {
@loaded {
resid plateID;
resid tabID;
int plate_width;
plateID = GuiChildByName(SELF, "plate");
tabID = GuiChildByName(SELF, "tab");
plate_width = ResPropGetInt(plateID, "Width");
ResPropSetInt(SELF, "rest_x", - plate_width);
ResPropSetInt(tabID, "X", plate_width - 4);
}
};
ChildID = {
GuiAnimation("plate") {
AnimationID = "gui/dash/tab/plate/plate.pcx";
X = 0;
Width = 230;
Height = 180;
},
GuiAnimation("tab") {
X = 235;
Y = 118;
AnimationID = "gui/dash/tab/maintenance/maintenance_off.pcx";
ScriptID = script {
@activate {
resid Parent;
resid Player;
resid Game;
Game = ResByName("Game");
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
Parent = GuiParent(SELF);
if ( ResPropGetResID(Player,"truck_tab_expanded") == Parent) {
ResPropSetResID(Player,"truck_tab_expanded",RES_INVALID);
ResPropSetInt( GuiSiblingByName("no_repairs_needed"), "Hidden", TRUE );
ResPropSetInt( GuiSiblingByName("repairs_needed"), "Hidden", TRUE);
ResPropSetInt( GuiSiblingByName("no_flat_tire"), "Hidden", TRUE );
ResPropSetInt( GuiSiblingByName("have_flat_tire"), "Hidden", TRUE );
} else {
ResPropSetResID(Player,"truck_tab_expanded",Parent);
GuiToFront(Parent);
}
}
@animate {
resid Parent;
int state;
int truck_broken;
int truck_tire_flat;
resid Player;
resid Game;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
Parent = GuiParent(SELF);
ResPropAlias(Player,"truck_broken","truck_broken");
ResPropAlias(Player,"truck_tire_flat","truck_tire_flat");
if (truck_tire_flat == 1) {
if (ResPropGetResID(ResByName("maintenance.tab/tab"),"AnimationID") != ResByName("gui/dash/tab/maintenance/maintenance_on.pcx")) {
ResPropSetResID(ResByName("maintenance.tab/tab"),"AnimationID",ResByName("gui/dash/tab/maintenance/maintenance_on.pcx"));
}
}
if ( ResPropGetResID(Player,"truck_tab_expanded") == Parent) {
ResPropSetInt(Parent,"X",ResPropGetInt(Parent,"expand_x"));
ResPropSetInt(GuiSiblingByName("plate"),"Hidden",FALSE);
/* if a tire is flat then show fix message */
if (truck_tire_flat == 1) {
ResPropSetInt( GuiSiblingByName("no_flat_tire"), "Hidden", TRUE );
ResPropSetInt( GuiSiblingByName("have_flat_tire"), "Hidden", FALSE );
} else {
ResPropSetInt( GuiSiblingByName("no_flat_tire"), "Hidden", FALSE );
ResPropSetInt( GuiSiblingByName("have_flat_tire"), "Hidden", TRUE );
}
/* if truck is broken then show fix message*/
if (truck_broken == 1) {
ResPropSetInt( GuiSiblingByName("no_repairs_needed"), "Hidden", TRUE );
ResPropSetInt( GuiSiblingByName("repairs_needed"), "Hidden", FALSE );
} else {
ResPropSetInt( GuiSiblingByName("no_repairs_needed"), "Hidden", FALSE );
ResPropSetInt( GuiSiblingByName("repairs_needed"), "Hidden", TRUE );
}
} else {
ResPropSetInt(GuiSiblingByName("plate"),"Hidden",TRUE);
ResPropSetInt(Parent,"X",ResPropGetInt(Parent,"rest_x"));
}
}
}
},
GuiLayer("chains_layer") {
X = 25;
Y = 0;
ChildID = {
GuiTextInput("chains_label") {
X = 0;
Y = 5;
Width = 185;
Height = 45;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/tab_w_on_g.tf";
},
GuiTextInput("chains_message") {
X = 0;
Y = 20;
Width = 190;
Height = 40;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/verdana_9.tf";
ScriptID = Script {
@animate {
resid Player;
resid Game;
int truck_chains_on;
str precip;
str text;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
ResPropAlias(Player,"truck_chains_on","truck_chains_on");
ResPropAlias(Player,"weather_precip","precip");
ResPropAlias(SELF,"InputText","text");
ResPropSetStr(GuiSiblingByName("chains_label"),"InputText",MangleSIDToStr(163/*"Chains"*/));
if ( (truck_chains_on == 0) && StrExact("s",precip) ) {
text = MangleSIDToStr(164/*"There's snow on the road. You should put chains on your tires."*/);
}
if ( (truck_chains_on == 1) && StrExact("s",precip) ) {
text = MangleSIDToStr(165/*"Chains improve traction on snowy roads."*/);
}
if ( (truck_chains_on == 0) && (StrExact("n",precip) || StrExact("r",precip)) ) {
text = MangleSIDToStr(166/*"Chains improve traction in the snow, but they damage bare roads."*/);
}
if ( (truck_chains_on == 1) && (StrExact("n",precip) || StrExact("r",precip)) ) {
text = MangleSIDToStr(167/*"Chains damage bare roads. Take them off to avoid getting a ticket."*/);
}
}
};
},
GuiButtonGroup("on_button") {
X = 80;
Y = 8;
RadioGroupID = 1;
ScriptID = Script {
@show {
resid Player;
resid Game;
int truck_chains_on;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
ResPropAlias(Player,"truck_chains_on","truck_chains_on");
if (truck_chains_on == 1) {
ResPropSetResID(SELF,"RadioGroupSelectedID",SELF);
} else {
ResPropSetResID(SELF,"RadioGroupSelectedID",GuiSiblingByName("off_button"));
}
}
@activate {
resid Player;
resid Game;
resid ChainsOnSound;
int truck_chains_on;
int time_now;
int hunger;
int fatigue;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
ResPropAlias(Player,"truck_chains_on","truck_chains_on");
ResPropAlias(Player,"time_now","time_now");
ResPropAlias(Player,"player_hunger","hunger");
ResPropAlias(Player,"player_fatigue","fatigue");
if (truck_chains_on == 1) {
stop;
}
ChainsOnSound = ResByNAme("sound/chains_on.wav");
ResParseEvent(ResByName("dash.gl/brake_pedal"),"@activate");
truck_chains_on = 1;
time_now += 7200;
fatigue = Min(ResPropGetInt(Game,"game_fatigue_limit"), fatigue + 7200);
hunger = Min(ResPropGetInt(Game,"game_hunger_limit"), hunger + 7200);
AudioPlay(ChainsOnSound);
ResParseEvent(ResByName("common/set_night_day.c4"),"@set_night_day");
}
};
ChildID = {
GuiButton("on_false") {
HorizontalAlign = RIGHTOF;
HorizontalPadding = 6;
StyleID = "gui/bs/radiounsel.gbs";
TextID = Mangle(168/*"on"*/);
FontID = "font/tab_w_on_g.tf";
},
GuiButton("on_true") {
HorizontalAlign = RIGHTOF;
HorizontalPadding = 6;
StyleID = "gui/bs/radiosel.gbs";
TextID = Mangle(169/*"on"*/);
FontID = "font/tab_w_on_g.tf";
}
};
},
GuiButtonGroup("off_button") {
X = 130;
Y = 8;
RadioGroupID = 1;
ScriptID = Script {
@activate {
resid Player;
resid Game;
resid ChainsOffSound;
int truck_chains_on;
int time_now;
int hunger;
int fatigue;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
ResPropAlias(Player,"truck_chains_on","truck_chains_on");
ResPropAlias(Player,"time_now","time_now");
ResPropAlias(Player,"player_hunger","hunger");
ResPropAlias(Player,"player_fatigue","fatigue");
if (truck_chains_on == 0) {
stop;
}
ChainsOffSound = ResByNAme("sound/chains_off.wav");
ResParseEvent(ResByName("dash.gl/brake_pedal"),"@activate");
truck_chains_on = 0;
time_now += 7200;
fatigue = Min(ResPropGetInt(Game,"game_fatigue_limit"), fatigue + 7200);
hunger = Min(ResPropGetInt(Game,"game_hunger_limit"), hunger + 7200);
AudioPlay(ChainsOffSound);
ResParseEvent(ResByName("common/set_night_day.c4"),"@set_night_day");
}
};
ChildID = {
GuiButton("off_false") {
HorizontalAlign = RIGHTOF;
HorizontalPadding = 6;
StyleID = "gui/bs/radiounsel.gbs";
TextID = Mangle(170/*"off"*/);
FontID = "font/tab_w_on_g.tf";
},
GuiButton("off_true") {
HorizontalAlign = RIGHTOF;
HorizontalPadding = 6;
StyleID = "gui/bs/radiosel.gbs";
TextID = Mangle(171/*"off"*/);
FontID = "font/tab_w_on_g.tf";
}
};
},
GuiButton("chains_button") {
X = 40;
Y = 20;
Hidden = TRUE;
StyleID = "gui/dash/tab/button/tab.gbs";
FontID = "font/tab_button.tf";
Width = 120;
AutoSize = Height;
ScriptID = Script {
@show {
}
@activate {
resid Player;
resid Game;
int truck_chains_on;
int text_id;
Game = ResByName("Game");
Player = ResPropGetResID(Game,"game_cur_player");
ResPropAlias(Player,"truck_chains_on","truck_chains_on");
ResPropAlias(SELF,"TextID","text_id");
if (truck_chains_on == 1) {
text_id = MangleSIDToSID(172/*"Put Chains On"*/);
truck_chains_on = 0;
} else {
text_id = MangleSIDToSID(173/*"Take Chains Off"*/);
truck_chains_on = 1;
}
}
}
}
};
},
GuiAnimation("line") {
AnimationID = "gui/dash/tab/line/line.pcx";
X = 25;
Y = 55;
},
GuiLayer("no_flat_tire") {
X = 25;
Y = 55;
ChildID = {
GuiTextInput("no_flat_tire_label") {
X = 0;
Y = 5;
Width = 185;
Height = 45;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/tab_w_on_g.tf";
},
GuiTextInput("no_flat_tire_message") {
X = 0;
Y = 20;
Width = 190;
Height = 40;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/verdana_9.tf";
ScriptID = Script {
@animate {
ResPropSetStr(GuiSiblingByName("no_flat_tire_label"),"InputText",MangleSIDToStr(174/*"No Flat Tire"*/));
ResPropSetStr(SELF,"InputText",MangleSIDToStr(175/*"Your tires have no holes and have good tread."*/));
}
};
}
};
},
GuiLayer("have_flat_tire") {
X = 25;
Y = 55;
ChildID = {
GuiTextInput("have_flat_tire_label") {
X = 0;
Y = 5;
Width = 185;
Height = 45;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/tab_w_on_g.tf";
},
GuiTextInput("have_flat_tire_message") {
X = 0;
Y = 20;
Width = 190;
Height = 40;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/verdana_9.tf";
ScriptID = Script {
@animate {
ResPropSetStr(GuiSiblingByName("have_flat_tire_label"),"InputText",MangleSIDToStr(176/*"You have a flat tire!"*/));
ResPropSetStr(SELF,"InputText",MangleSIDToStr(177/*""*/));
}
};
},
GuiButton("fix_flat") {
X = 45;
Y = 30;
TextID = Mangle(178/*"Fix Yourself"*/);
StyleID = "gui/dash/tab/button/tab.gbs";
FontID = "font/tab_button.tf";
Width = 120;
AutoSize = Height;
ScriptID = Script {
@activate {
resid Player;
resid Game;
Game = ResByName("Game");
Player = ResPropGetResID(ResByName("Game"),"game_cur_player");
AudioPlay(ResByName("sound/fix_flat.wav"));
ResPropSetInt(Player,"truck_tire_flat",0);
ResPropSetInt(Player,"time_now",(ResPropGetInt(Player,"time_now") + 10800) /* 3 hours */);
ResPropSetInt(Player,"player_fatigue",(ResPropGetInt(Player,"player_fatigue") + 21600) /* 6 hours */);
ResPropSetStr(ResByName("dash.gl/message"), "InputText", MangleSIDToStr(179/*"After struggling for a few hours, you manage to fix the flat yourself."*/));
ResPropSetInt(ResByName("dash.gl/message"), "timeout", CVarGetInt("framerate") * 6);
ResPropSetResID(ResByName("maintenance.tab/tab"),"AnimationID",ResByName("gui/dash/tab/maintenance/maintenance_off.pcx"));
}
}
}
};
},
GuiAnimation("no_repair_line") {
AnimationID = "gui/dash/tab/line/line.pcx";
X = 25;
Y = 115;
},
GuiLayer("no_repairs_needed") {
X = 25;
Y = 115;
ChildID = {
GuiTextInput("no_repairs_needed_label") {
X = 0;
Y = 5;
Width = 185;
Height = 40;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/tab_w_on_g.tf";
},
GuiTextInput("no_repairs_needed_message") {
X = 0;
Y = 20;
Width = 190;
Height = 50;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/verdana_9.tf";
ScriptID = Script {
@animate {
ResPropSetStr(GuiSiblingByName("no_repairs_needed_label"),"InputText",MangleSIDToStr(180/*"No repairs needed."*/));
ResPropSetStr(SELF,"InputText",MangleSIDToStr(181/*"Your truck is running smoothly."*/));
}
};
}
};
},
GuiLayer("repairs_needed") {
X = 25;
Y = 115;
ChildID = {
GuiTextInput("repairs_needed_label") {
X = 0;
Y = 5;
Width = 185;
Height = 40;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/tab_w_on_g.tf";
},
GuiTextInput("repairs_needed_message") {
X = 0;
Y = 20;
Width = 190;
Height = 50;
WordWrap = TRUE;
InputDisabled = TRUE;
FontID = "font/verdana_9.tf";
ScriptID = Script {
@animate {
ResPropSetStr(GuiSiblingByName("repairs_needed_label"),"InputText",MangleSIDToStr(182/*"Repairs Needed"*/));
ResPropSetStr(SELF,"InputText",MangleSIDToStr(183/*"Your truck needs repairs."*/));
}
};
}
};
}
};
}